#!/usr/bin/env bash

declare -r DOCKER_HUB="docker-hub:5000"
declare -r MYSQL_HOME="/appdata/mysql"

sudo mkdir -p ${MYSQL_HOME}/{config,data}

sudo docker run -d --name mysql \
  --restart always \
  -p 3306:3306 -p 33060:33060 \
  -e MYSQL_ROOT_PASSWORD=b846ayaj51 \
  -e MYSQL_ROOT_HOST=% \
  -e TZ=Asia/Shanghai \
  -v ${MYSQL_HOME}/data:/var/lib/mysql \
  -v ${MYSQL_HOME}/config/my.cnf:/etc/my.cnf \
  ${DOCKER_HUB}/mysql/mysql-server:8.0.27
